package com.firmboy.io_collection.io;

import org.junit.Test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;

/**
 * 测试一些基础的IO工具类
 *
 * @author firmboy
 * @create 2018-04-13 下午9:41
 **/
public class IOTest {

    /**
     *
     */
    @Test
    public void FileInputStreamTest() throws IOException {
        //复制一个图片
        URL resource = this.getClass().getResource("/");
        String path = resource.getPath();
        System.out.println(path);

        FileOutputStream file = new FileOutputStream(path + "/" + "1.txt");
        file.write("hello world".getBytes());

        file.close();

    }




}
